package com;

import javax.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import com.bean.Student;
import com.opensymphony.xwork2.ActionSupport;
import com.service.StudentService;


public class DeleteStudentAction extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Resource(type=Student.class)
	private Student student;
	
	@Autowired
	@Qualifier("studentService")
	private StudentService studentService;

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	@Override
	public String execute() throws Exception {
		try 
		{
			studentService.deleteStudent(student);
			return SUCCESS;
		}
		catch (Exception e)
		{
			e.printStackTrace();
			return ERROR;
		}
	}

}
